

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Study &mdash; Optuna 1.4.0 文档</title>
  

  
  
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="Trial" href="trial.html" />
    <link rel="prev" title="Structs" href="structs.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> Optuna
          

          
          </a>

          
            
            
              <div class="version">
                1.4.0
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">目录</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">教程</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="core.html">Core</a></li>
<li class="toctree-l2"><a class="reference internal" href="cli.html">Command Line Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="distributions.html">Distributions</a></li>
<li class="toctree-l2"><a class="reference internal" href="exceptions.html">Exceptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="importance.html">Hyperparameter Importance</a></li>
<li class="toctree-l2"><a class="reference internal" href="integration.html">Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="multi_objective/index.html">Multi-objective</a></li>
<li class="toctree-l2"><a class="reference internal" href="pruners.html">Pruners</a></li>
<li class="toctree-l2"><a class="reference internal" href="samplers.html">Samplers</a></li>
<li class="toctree-l2"><a class="reference internal" href="storages.html">Storages</a></li>
<li class="toctree-l2"><a class="reference internal" href="structs.html">Structs</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Study</a></li>
<li class="toctree-l2"><a class="reference internal" href="trial.html">Trial</a></li>
<li class="toctree-l2"><a class="reference internal" href="visualization.html">Visualization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../faq.html">常见问题</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Optuna</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="index.html">API Reference</a> &raquo;</li>
        
      <li>Study</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/reference/study.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <span class="target" id="module-optuna.study"></span><div class="section" id="study">
<h1>Study<a class="headerlink" href="#study" title="永久链接至标题">¶</a></h1>
<dl class="py class">
<dt id="optuna.study.Study">
<em class="property">class </em><code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">Study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study_name</span></em>, <em class="sig-param"><span class="n">storage</span></em>, <em class="sig-param"><span class="n">sampler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">pruner</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#Study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study" title="永久链接至目标">¶</a></dt>
<dd><p>一个 study 对应于一个优化任务，即一组 trials.</p>
<p>该对象提供了接口用于运行新的 <a class="reference internal" href="trial.html#optuna.trial.Trial" title="optuna.trial.Trial"><code class="xref py py-class docutils literal notranslate"><span class="pre">Trial</span></code></a>, 获取 trial 的历史记录和设置/获取 study 中用户定义的属性。</p>
<p>注意，我们不建议直接使用这个构造函数。要创建或者加载 study 的话，请参考 <a class="reference internal" href="#optuna.study.create_study" title="optuna.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 和 <a class="reference internal" href="#optuna.study.load_study" title="optuna.study.load_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">load_study()</span></code></a> 对应的文档。</p>
<dl class="py method">
<dt id="optuna.study.Study.best_params">
<em class="property">property </em><code class="sig-name descname">best_params</code><a class="headerlink" href="#optuna.study.Study.best_params" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 中最佳 trial 对应的参数。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>包含最佳 trial 的参数的字典。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.best_trial">
<em class="property">property </em><code class="sig-name descname">best_trial</code><a class="headerlink" href="#optuna.study.Study.best_trial" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 中最佳 trial.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>最佳 trial 的 <code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code>.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.best_value">
<em class="property">property </em><code class="sig-name descname">best_value</code><a class="headerlink" href="#optuna.study.Study.best_value" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 中的最佳目标函数值。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>代表最佳目标函数值的浮点数。</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.direction">
<em class="property">property </em><code class="sig-name descname">direction</code><a class="headerlink" href="#optuna.study.Study.direction" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 的优化方向。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>A <a class="reference internal" href="#optuna.study.StudyDirection" title="optuna.study.StudyDirection"><code class="xref py py-class docutils literal notranslate"><span class="pre">StudyDirection</span></code></a> object.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.enqueue_trial">
<code class="sig-name descname">enqueue_trial</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">params</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#Study.enqueue_trial"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study.enqueue_trial" title="永久链接至目标">¶</a></dt>
<dd><p>插入具有特定参数的 trial.</p>
<p>你可以固定下一次将被求值的目标函数对应的参数。</p>
<p class="rubric">示例</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">optuna</span>

<span class="k">def</span> <span class="nf">objective</span><span class="p">(</span><span class="n">trial</span><span class="p">):</span>
    <span class="n">x</span> <span class="o">=</span> <span class="n">trial</span><span class="o">.</span><span class="n">suggest_uniform</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">x</span> <span class="o">**</span> <span class="mi">2</span>

<span class="n">study</span> <span class="o">=</span> <span class="n">optuna</span><span class="o">.</span><span class="n">create_study</span><span class="p">()</span>
<span class="n">study</span><span class="o">.</span><span class="n">enqueue_trial</span><span class="p">({</span><span class="s1">&#39;x&#39;</span><span class="p">:</span> <span class="mi">5</span><span class="p">})</span>
<span class="n">study</span><span class="o">.</span><span class="n">enqueue_trial</span><span class="p">({</span><span class="s1">&#39;x&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">})</span>
<span class="n">study</span><span class="o">.</span><span class="n">optimize</span><span class="p">(</span><span class="n">objective</span><span class="p">,</span> <span class="n">n_trials</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>

<span class="k">assert</span> <span class="n">study</span><span class="o">.</span><span class="n">trials</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">params</span> <span class="o">==</span> <span class="p">{</span><span class="s1">&#39;x&#39;</span><span class="p">:</span> <span class="mi">5</span><span class="p">}</span>
<span class="k">assert</span> <span class="n">study</span><span class="o">.</span><span class="n">trials</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">params</span> <span class="o">==</span> <span class="p">{</span><span class="s1">&#39;x&#39;</span><span class="p">:</span> <span class="mi">0</span><span class="p">}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>params</strong> -- 传入目标函数的参数值。</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>在版本 v1.2.0 中作为一个试验性特性加入。该接口在未来可能在没有提前告知的情况下改变，见 <a class="reference external" href="https://github.com/optuna/optuna/releases/tag/v1.2.0">https://github.com/optuna/optuna/releases/tag/v1.2.0</a>.</p>
</div>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.get_trials">
<code class="sig-name descname">get_trials</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">deepcopy</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#optuna.study.Study.get_trials" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 中所有的 trial.</p>
<p>返回的 trial 是根据 trial number 来排序的。</p>
<p>我们推荐库用户使用更方便的 <a class="reference internal" href="#optuna.study.Study.trials" title="optuna.study.Study.trials"><code class="xref py py-attr docutils literal notranslate"><span class="pre">trials</span></code></a> 属性来获取 trial.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>deepcopy</strong> -- 用于控制是否对 trial 应用 <code class="docutils literal notranslate"><span class="pre">copy.deepcopy()</span></code> 的选项。注意：如果你把该选项设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> 的话，就不要改变返回的 trial 中的任何东西了。否则 study 的内部状态可能会崩坏且导致不可预知的情况发生。</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code> 对象的列表</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.optimize">
<code class="sig-name descname">optimize</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">func</span></em>, <em class="sig-param"><span class="n">n_trials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">timeout</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">n_jobs</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">catch</span><span class="o">=</span><span class="default_value">()</span></em>, <em class="sig-param"><span class="n">callbacks</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">gc_after_trial</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">show_progress_bar</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#Study.optimize"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study.optimize" title="永久链接至目标">¶</a></dt>
<dd><p>优化目标函数。</p>
<p>通过从一定范围内选择合适的超参数集合，该优化过程已经完成。使用一个从特定分布上获得 suggestion 值的 sampler. 该 sampler 是通过 <a class="reference internal" href="#optuna.study.create_study" title="optuna.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 来确定的。其默认值是 TPE. 关于 TPE 的更多细节见 <a class="reference internal" href="samplers.html#optuna.samplers.TPESampler" title="optuna.samplers.TPESampler"><code class="xref py py-class docutils literal notranslate"><span class="pre">TPESampler</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>func</strong> -- 目标函数。</p></li>
<li><p><strong>n_trials</strong> -- trial 的个数。如果该选项被设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话， trial 数就不存在限制了。如果 <code class="xref py py-obj docutils literal notranslate"><span class="pre">timeout</span></code> 也被设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话， 该 study 将会一直创建新 trial，除非它收到了一个比如 Ctrl+C 或者是 SIGTERM 的终止信号。</p></li>
<li><p><strong>timeout</strong> -- 该给定的秒数之后终止 study. 如果该选项被设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话，该 study 将会在没有时间限制的情况下一直运行。如果 <code class="xref py py-obj docutils literal notranslate"><span class="pre">n_trials</span></code> 也被设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话， 该 study 将会一直创建新 trial，除非它收到了一个比如 Ctrl+C 或者是 SIGTERM 的终止信号。</p></li>
<li><p><strong>n_jobs</strong> -- 并行运行的 job 数。如果该选项被设置成了 <code class="xref py py-obj docutils literal notranslate"><span class="pre">-1</span></code>, job 数目将等于 CPU 核心数。</p></li>
<li><p><strong>catch</strong> -- 该选项中指定一些异常，这样，当 trial 抛出这些异常时，study 仍然会继续运行。默认情况下这是一个空元组，也就是说， study 会在碰到任何除 <a class="reference internal" href="exceptions.html#optuna.exceptions.TrialPruned" title="optuna.exceptions.TrialPruned"><code class="xref py py-class docutils literal notranslate"><span class="pre">TrialPruned</span></code></a> 之外的异常时都终止运行。</p></li>
<li><p><strong>callbacks</strong> -- 一系列在每个 trial 终止时会被调用的回调函数。每个函数必须按照 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 和 <code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code> 的顺序接受两个对应类型的参数。</p></li>
<li><p><strong>gc_after_trial</strong> -- 用于确认是否在每个 trial 完成以后进行垃圾回收的选项。设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a> 的话，垃圾回收就会运行，设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> 就不会了。如果运行的话，他就在内部调用 <a class="reference external" href="https://docs.python.org/3/library/gc.html#gc.collect" title="(在 Python v3.8)"><code class="xref py py-func docutils literal notranslate"><span class="pre">gc.collect()</span></code></a>. 如果你发现在数个 trial 之后内存消耗猛增，请试试把该选项设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#True" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">True</span></code></a>.</p></li>
<li><p><strong>show_progress_bar</strong> -- 设置是否显示进度条的选项。要禁用它的话，将其设置成 <code class="docutils literal notranslate"><span class="pre">False</span></code>. 目前这是一个试验性特性，并且当 <code class="docutils literal notranslate"><span class="pre">n_jobs</span></code> <span class="math notranslate nohighlight">\([\ne 1]\)</span> 时会被自动禁用。</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.set_user_attr">
<code class="sig-name descname">set_user_attr</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">value</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#Study.set_user_attr"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study.set_user_attr" title="永久链接至目标">¶</a></dt>
<dd><p>给 study 设定一个用户属性。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> -- 一个属性键值对。</p></li>
<li><p><strong>value</strong> -- 属性对应的值，该值应是可 JSON 序列化的。</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.stop">
<code class="sig-name descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)">None</a><a class="reference internal" href="../_modules/optuna/study.html#Study.stop"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study.stop" title="永久链接至目标">¶</a></dt>
<dd><p>当正在运行的 trial 结束以后，推出当前的优化过程。</p>
<p>该方法会正在运行的 <a class="reference internal" href="#optuna.study.Study.optimize" title="optuna.study.Study.optimize"><code class="xref py py-meth docutils literal notranslate"><span class="pre">optimize()</span></code></a> 终止，只要其中由 <a class="reference internal" href="#optuna.study.Study.optimize" title="optuna.study.Study.optimize"><code class="xref py py-meth docutils literal notranslate"><span class="pre">optimize()</span></code></a> 生成的 trial 都结束了。该方法不会影响并行或者序列执行的 study 的任何行为。</p>
<dl class="field-list simple">
<dt class="field-odd">引发</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#RuntimeError" title="(在 Python v3.8)"><strong>RuntimeError</strong></a> -- 如果该方法实在目标函数或者一个回调函数之外被调用的话。</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>在版本 v1.4.0 中作为一个试验性特性加入。该接口在未来可能在没有提前告知的情况下改变，见 <a class="reference external" href="https://github.com/optuna/optuna/releases/tag/v1.4.0">https://github.com/optuna/optuna/releases/tag/v1.4.0</a>.</p>
</div>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.trials">
<em class="property">property </em><code class="sig-name descname">trials</code><a class="headerlink" href="#optuna.study.Study.trials" title="永久链接至目标">¶</a></dt>
<dd><p>返回 study 中所有的 trial.</p>
<p>返回的 trial 是根据 trial number 来排序的。</p>
<p>是 <code class="docutils literal notranslate"><span class="pre">self.get_trials(deepcopy=True)</span></code> 的简写形式。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code> 对象的列表</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.trials_dataframe">
<code class="sig-name descname">trials_dataframe</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">attrs</span><span class="o">=</span><span class="default_value">'number', 'value', 'datetime_start', 'datetime_complete', 'duration', 'params', 'user_attrs', 'system_attrs', 'state'</span></em>, <em class="sig-param"><span class="n">multi_index</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#Study.trials_dataframe"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.Study.trials_dataframe" title="永久链接至目标">¶</a></dt>
<dd><p>将 trial 导出为 pandas <a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html">DataFrame</a>.</p>
<p><a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html">DataFrame</a> 提供了各种用于分析 study 的特性。它也可以用来画目标函数值的直方图或者将 trial 导出成 CSV 文件。如果 study 中没有 trial 的话，会返回一个空的 <a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html">DataFrame</a>.</p>
<p class="rubric">示例</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">optuna</span>
<span class="kn">import</span> <span class="nn">pandas</span>

<span class="k">def</span> <span class="nf">objective</span><span class="p">(</span><span class="n">trial</span><span class="p">):</span>
    <span class="n">x</span> <span class="o">=</span> <span class="n">trial</span><span class="o">.</span><span class="n">suggest_uniform</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">x</span> <span class="o">**</span> <span class="mi">2</span>

<span class="n">study</span> <span class="o">=</span> <span class="n">optuna</span><span class="o">.</span><span class="n">create_study</span><span class="p">()</span>
<span class="n">study</span><span class="o">.</span><span class="n">optimize</span><span class="p">(</span><span class="n">objective</span><span class="p">,</span> <span class="n">n_trials</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>

<span class="c1"># Create a dataframe from the study.</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">study</span><span class="o">.</span><span class="n">trials_dataframe</span><span class="p">()</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">pandas</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">df</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="mi">3</span>  <span class="c1"># n_trials.</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attrs</strong> -- 确定 <code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code> 的 field name, 将它们纳入 trial 的 DataFrame 中。</p></li>
<li><p><strong>multi_index</strong> -- 指定返回的 <a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html">DataFrame</a> 是否使用 <a class="reference external" href="https://pandas.pydata.org/pandas-docs/stable/advanced.html">MultiIndex</a>.如果该值为 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> 的话，那些本来是多层的列 （比如 <code class="docutils literal notranslate"><span class="pre">(params,</span> <span class="pre">x)</span></code>）将会被展平成 <code class="docutils literal notranslate"><span class="pre">params_x</span></code>.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 中的包含 trial 的 <a class="reference external" href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html">DataFrame</a>.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="optuna.study.Study.user_attrs">
<em class="property">property </em><code class="sig-name descname">user_attrs</code><a class="headerlink" href="#optuna.study.Study.user_attrs" title="永久链接至目标">¶</a></dt>
<dd><p>返回用户属性。</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p>包含所有用户属性的字典。</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt id="optuna.study.create_study">
<code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">create_study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">storage</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">sampler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">pruner</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">study_name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">direction</span><span class="o">=</span><span class="default_value">'minimize'</span></em>, <em class="sig-param"><span class="n">load_if_exists</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#create_study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.create_study" title="永久链接至目标">¶</a></dt>
<dd><p>创建新的 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>storage</strong> -- 数据库 URL. 如果该参数被设置成 None 的话，Optuna 将采用内存存储。此时 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 将无法被持久化。  .. note::     当传入一个数据库URL之后，在内部，Optuna 将会使用 <a class="reference internal" href="#sqlalchemy">SQLAlchemy</a> 来处理数据库。更多细节请参考 <a class="reference internal" href="#sqlalchemy-s-document">SQLAlchemy's document</a>. 如果你想改变默认的 <a class="reference internal" href="#sqlalchemy-engine">SQLAlchemy Engine</a> 的话，你可以用你想要用的引擎实例化一个 <a class="reference internal" href="storages.html#optuna.storages.RDBStorage" title="optuna.storages.RDBStorage"><code class="xref py py-class docutils literal notranslate"><span class="pre">RDBStorage</span></code></a>, 并将其而不是一个 URL 传入 <code class="docutils literal notranslate"><span class="pre">storage</span></code> 参数。   .. _SQLAlchemy: <a class="reference external" href="https://www.sqlalchemy.org/">https://www.sqlalchemy.org/</a>  .. _SQLAlchemy 的文档:      <a class="reference external" href="https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls">https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls</a>  .. _SQLAlchemy Engine: <a class="reference external" href="https://docs.sqlalchemy.org/en/latest/core/engines.html">https://docs.sqlalchemy.org/en/latest/core/engines.html</a></p></li>
<li><p><strong>sampler</strong> -- 一个实现了用于参数 suggestion 的 sampler 对象。如果设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话，默认会启用 <a class="reference internal" href="samplers.html#optuna.samplers.TPESampler" title="optuna.samplers.TPESampler"><code class="xref py py-class docutils literal notranslate"><span class="pre">TPESampler</span></code></a>. 参见 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-class docutils literal notranslate"><span class="pre">samplers</span></code></a>.</p></li>
<li><p><strong>pruner</strong> -- 一个用于确定提前终止无望 trial 的 pruner 对象。参见 <a class="reference internal" href="pruners.html#module-optuna.pruners" title="optuna.pruners"><code class="xref py py-class docutils literal notranslate"><span class="pre">pruners</span></code></a>.</p></li>
<li><p><strong>study_name</strong> -- Study 名。如果该参数是 None 的话，Optuna 会自动生成一个唯一的名字。</p></li>
<li><p><strong>direction</strong> -- 优化方向。设置成 <code class="docutils literal notranslate"><span class="pre">minimize</span></code> 就是最小化，设置成 <code class="docutils literal notranslate"><span class="pre">maximize</span></code> 就是最大化。</p></li>
<li><p><strong>load_if_exists</strong> -- 用于处理 study 名冲突情况下行为的选项。当 <code class="docutils literal notranslate"><span class="pre">storage</span></code> 中已经存在同名 <code class="docutils literal notranslate"><span class="pre">study_name</span></code> 时，如果此时 <code class="docutils literal notranslate"><span class="pre">load_if_exists</span></code> 是设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#False" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">False</span></code></a> 的话，<a class="reference internal" href="exceptions.html#optuna.exceptions.DuplicatedStudyError" title="optuna.exceptions.DuplicatedStudyError"><code class="xref py py-class docutils literal notranslate"><span class="pre">DuplicatedStudyError</span></code></a> 异常会被抛出。否则，创建 study 的过程将会被跳过，已经存在的那个 study 会被返回。</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 对象。</p>
</dd>
</dl>
</dd></dl>

<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p>也可以使用它的别名 <a class="reference internal" href="core.html#optuna.create_study" title="optuna.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.create_study()</span></code></a>.</p>
</div>
<dl class="py function">
<dt id="optuna.study.load_study">
<code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">load_study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study_name</span></em>, <em class="sig-param"><span class="n">storage</span></em>, <em class="sig-param"><span class="n">sampler</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">pruner</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#load_study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.load_study" title="永久链接至目标">¶</a></dt>
<dd><p>加载一个指定名字的已经存在的 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>study_name</strong> -- Study 名，每个 study 都有一个唯一的作为标识符的名字。</p></li>
<li><p><strong>storage</strong> -- 诸如 <code class="docutils literal notranslate"><span class="pre">sqlite:///example.db</span></code> 这样的数据库 URL. 更多细节见 <a class="reference internal" href="#optuna.study.create_study" title="optuna.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 的文档。</p></li>
<li><p><strong>sampler</strong> -- 一个实现了用于参数 suggestion 的 sampler 对象。如果设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话，默认会启用 <a class="reference internal" href="samplers.html#optuna.samplers.TPESampler" title="optuna.samplers.TPESampler"><code class="xref py py-class docutils literal notranslate"><span class="pre">TPESampler</span></code></a>. 参见 <a class="reference internal" href="samplers.html#module-optuna.samplers" title="optuna.samplers"><code class="xref py py-class docutils literal notranslate"><span class="pre">samplers</span></code></a>.</p></li>
<li><p><strong>pruner</strong> -- 一个用于确定提前终止无望 trial 的 pruner 对象。如果设置成 <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(在 Python v3.8)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a> 的话，默认将会启用  <a class="reference internal" href="pruners.html#optuna.pruners.MedianPruner" title="optuna.pruners.MedianPruner"><code class="xref py py-class docutils literal notranslate"><span class="pre">MedianPruner</span></code></a>.具体参见 <a class="reference internal" href="pruners.html#module-optuna.pruners" title="optuna.pruners"><code class="xref py py-class docutils literal notranslate"><span class="pre">pruners</span></code></a>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p>也可以使用它的别名 <a class="reference internal" href="core.html#optuna.load_study" title="optuna.load_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.load_study()</span></code></a>.</p>
</div>
<dl class="py function">
<dt id="optuna.study.delete_study">
<code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">delete_study</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study_name</span></em>, <em class="sig-param"><span class="n">storage</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#delete_study"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.delete_study" title="永久链接至目标">¶</a></dt>
<dd><p>删除一个 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 对象。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>study_name</strong> -- Study 名。</p></li>
<li><p><strong>storage</strong> -- 诸如 <code class="docutils literal notranslate"><span class="pre">sqlite:///example.db</span></code> 这样的数据库 URL. 更多细节见 <a class="reference internal" href="#optuna.study.create_study" title="optuna.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 的文档。</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p>也可以使用它的别名 <a class="reference internal" href="core.html#optuna.delete_study" title="optuna.delete_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.delete_study()</span></code></a>.</p>
</div>
<dl class="py function">
<dt id="optuna.study.get_all_study_summaries">
<code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">get_all_study_summaries</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">storage</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/study.html#get_all_study_summaries"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.get_all_study_summaries" title="永久链接至目标">¶</a></dt>
<dd><p>返回指定存储中 所有 study 的历史记录。</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>storage</strong> -- 诸如 <code class="docutils literal notranslate"><span class="pre">sqlite:///example.db</span></code> 这样的数据库 URL. 更多细节见 <a class="reference internal" href="#optuna.study.create_study" title="optuna.study.create_study"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_study()</span></code></a> 的文档。</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p>以 <a class="reference internal" href="#optuna.study.StudySummary" title="optuna.study.StudySummary"><code class="xref py py-class docutils literal notranslate"><span class="pre">StudySummary</span></code></a> 对象形式存在的 study 历史记录的列表。</p>
</dd>
</dl>
</dd></dl>

<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p>也可以使用它的别名 <a class="reference internal" href="core.html#optuna.get_all_study_summaries" title="optuna.get_all_study_summaries"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.get_all_study_summaries()</span></code></a>.</p>
</div>
<dl class="py class">
<dt id="optuna.study.StudyDirection">
<em class="property">class </em><code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">StudyDirection</code><a class="reference internal" href="../_modules/optuna/_study_direction.html#StudyDirection"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.StudyDirection" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 的方向。</p>
<dl class="py attribute">
<dt id="optuna.study.StudyDirection.NOT_SET">
<code class="sig-name descname">NOT_SET</code><a class="headerlink" href="#optuna.study.StudyDirection.NOT_SET" title="永久链接至目标">¶</a></dt>
<dd><p>方向未设置。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudyDirection.MINIMIZE">
<code class="sig-name descname">MINIMIZE</code><a class="headerlink" href="#optuna.study.StudyDirection.MINIMIZE" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 将最小化目标函数</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudyDirection.MAXIMIZE">
<code class="sig-name descname">MAXIMIZE</code><a class="headerlink" href="#optuna.study.StudyDirection.MAXIMIZE" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 将最大化目标函数</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="optuna.study.StudySummary">
<em class="property">class </em><code class="sig-prename descclassname">optuna.study.</code><code class="sig-name descname">StudySummary</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">study_name</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a></span></em>, <em class="sig-param"><span class="n">direction</span><span class="p">:</span> <span class="n">optuna._study_direction.StudyDirection</span></em>, <em class="sig-param"><span class="n">best_trial</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>optuna.trial._frozen.FrozenTrial<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">user_attrs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">, </span>Any<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">system_attrs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.8)">str</a><span class="p">, </span>Any<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">n_trials</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em>, <em class="sig-param"><span class="n">datetime_start</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.datetime" title="(在 Python v3.8)">datetime.datetime</a><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">study_id</span><span class="p">:</span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.8)">int</a></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/optuna/_study_summary.html#StudySummary"><span class="viewcode-link">[源代码]</span></a><a class="headerlink" href="#optuna.study.StudySummary" title="永久链接至目标">¶</a></dt>
<dd><p>一个 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 的基本属性和简要结果。</p>
<p>参见 <a class="reference internal" href="#optuna.study.get_all_study_summaries" title="optuna.study.get_all_study_summaries"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.study.get_all_study_summaries()</span></code></a>.</p>
<dl class="py attribute">
<dt id="optuna.study.StudySummary.study_name">
<code class="sig-name descname">study_name</code><a class="headerlink" href="#optuna.study.StudySummary.study_name" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 名。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.direction">
<code class="sig-name descname">direction</code><a class="headerlink" href="#optuna.study.StudySummary.direction" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 的 <a class="reference internal" href="#optuna.study.StudyDirection" title="optuna.study.StudyDirection"><code class="xref py py-class docutils literal notranslate"><span class="pre">StudyDirection</span></code></a></p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.best_trial">
<code class="sig-name descname">best_trial</code><a class="headerlink" href="#optuna.study.StudySummary.best_trial" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 中有着最佳目标函数值的 <code class="xref py py-class docutils literal notranslate"><span class="pre">FrozenTrial</span></code>.</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.user_attrs">
<code class="sig-name descname">user_attrs</code><a class="headerlink" href="#optuna.study.StudySummary.user_attrs" title="永久链接至目标">¶</a></dt>
<dd><p>通过 <a class="reference internal" href="#optuna.study.Study.set_user_attr" title="optuna.study.Study.set_user_attr"><code class="xref py py-func docutils literal notranslate"><span class="pre">optuna.study.Study.set_user_attr()</span></code></a> 来设置的，包含 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 中属性的字典。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.system_attrs">
<code class="sig-name descname">system_attrs</code><a class="headerlink" href="#optuna.study.StudySummary.system_attrs" title="永久链接至目标">¶</a></dt>
<dd><p>由 Optuna 设定的，包含 <a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 中属性的字典。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.n_trials">
<code class="sig-name descname">n_trials</code><a class="headerlink" href="#optuna.study.StudySummary.n_trials" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 运行过的 trial 数目。</p>
</dd></dl>

<dl class="py attribute">
<dt id="optuna.study.StudySummary.datetime_start">
<code class="sig-name descname">datetime_start</code><a class="headerlink" href="#optuna.study.StudySummary.datetime_start" title="永久链接至目标">¶</a></dt>
<dd><p><a class="reference internal" href="#optuna.study.Study" title="optuna.study.Study"><code class="xref py py-class docutils literal notranslate"><span class="pre">Study</span></code></a> 开始的日期。</p>
</dd></dl>

</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="trial.html" class="btn btn-neutral float-right" title="Trial" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="structs.html" class="btn btn-neutral float-left" title="Structs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, Optuna Contributors.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
    <a href="../privacy.html">Privacy Policy</a>.
     


</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-55135190-8', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>